import requests
import re
import pyttsx3
import sys

class ttsx(object):
      def __init__(self,rate=-20):
          self.rate = rate
      def sayText(self,str):
          self.engine = pyttsx3.init()
         #语速
          rate = self.engine.getProperty('rate')
          self.engine.setProperty('rate', 330 )

         #音量
         #volume = self.engine.getProperty('volume')
          self.engine.setProperty('volume', 1)

         #声音
         #voices = self.engine.getProperty('voices')
         #for voice in voices:
         #   self.engine.setProperty('voice', voice.id)
         #   print(voice.id)
          self.engine.say(str)
          self.engine.runAndWait()

ttx = ttsx()
ttx.__init__(20)
# 2901  岳父朱棣，迎娶毁容郡主我乐麻了.txt
# 1248      第一次魔法世界大战
f = open("E:\\学习\\fiction\\lmdi.txt",encoding='utf-8')
lines = f.readlines()
for number in range(28169, 187275):
    #sys.stdin.readline()
    print(number)
   #if tint==8:
    #    exit(0)
    #print(number.__str__()+lines[number], end="")
    #tint+=1
    ttx.sayText(lines[number])
